﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WorkStation.UI.Controls
{
    public class TextMotion : MotionShape
    {
        public string Text;
        public string FontName;
        public float FontSize;
        public PointF StartPoint;
        public double RotateAngle;
        public TextMotion()
        {

        }
        public TextMotion(string description)
            : base(description)
        {

        }

        public override void Draw(Graphics g)
        {
            if (RotateAngle != 0)
            {
                g.TranslateTransform(this.StartPoint.X, this.StartPoint.Y);
                g.RotateTransform((float)RotateAngle);

                g.DrawString(Text, new Font(FontName, FontSize, FontStyle.Regular), new SolidBrush(PaintColor), new PointF(0, 0));

                g.RotateTransform(-(float)RotateAngle);
                g.TranslateTransform(-this.StartPoint.X, -this.StartPoint.Y);
            }
            else
                g.DrawString(Text, new Font(FontName, FontSize, FontStyle.Regular), new SolidBrush(PaintColor), this.StartPoint);
        }
    }
}
